function padNum(num) {
  return String(num).padStart(2, "0");
}

function dateToText(date) {
  return `${date.getFullYear()}-${padNum(date.getMonth() + 1)}-${padNum(date.getDate())}`;
}

function getWeekName(week) {
  switch (week) {
    case 0: return "日";
    case 1: return "一";
    case 2: return "二";
    case 3: return "三";
    case 4: return "四";
    case 5: return "五";
    case 6: return "六";
  }
}

function getMonthName(month) {
  switch (month) {
    case 0: return "一月";
    case 1: return "二月";
    case 2: return "三月";
    case 3: return "四月";
    case 4: return "五月";
    case 5: return "六月";
    case 6: return "七月";
    case 7: return "八月";
    case 8: return "九月";
    case 9: return "十月";
    case 10: return "十一月";
    case 11: return "十二月";
  }
}

export { getWeekName, getMonthName, dateToText };